package com.zh.freechat.domain.user;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
public class ChatUserDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1;

    private String uid;

    private String username;

    private String password;

    private String phone;

    private String email;

    private String avatarUrl;

    private String nickname;

    private String profile;

    private Integer score;  //积分

    private Integer status;    //账号状态：0未激活 <——> 1已激活——> 2冻结

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**账号级别*/
    private Integer grade;

    /**user的 role*/
    private String role;

    public ChatUserDTO() {}

    public ChatUserDTO(String uid, String username, String avatarUrl) {
        this.uid = uid;
        this.username = username;
        this.avatarUrl = avatarUrl;
    }

}
